<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>子元素浮动,引起父元素的高度塌陷</title>
    <style>
      .parent {
        padding: 5px;
        background-color: red;
      }
      .child img {
        width: 200px;
        height: 100px;
        float: left;
      }
      .clear:after {
        content: "";
        /* display: block; */
        display: table;
        /* display: list-item; */
        clear: both;
      }
    </style>
  </head>
  <body>
    <div class="parent clear">
      <div class="child">
        <img src="../00.imgs//tt01.jpg" />
      </div>
    </div>
  </body>
</html>
